import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        {
            path:'/',
            redirect:'/login'
        },
        {
            path:'/login',
            component:()=>import('@/pages/login')
        },
        {
            path:'/index',
            component:()=>import('@/pages/index')
        },
        {
            path:'/wj',
            component:()=>import('@/pages/wj')
        }

    ]
})

// router.beforeEach((to, from, next) => {
//     if (to.path == "/login") {
//         next()
//     } else {
//         let token = sessionStorage.getItem("token")
//         let time = sessionStorage.getItem("time")
//         if (token) {
//             if (new Date(Number(time)+60*1000)<new Date()){
//                 next("/login")
//             }else{
//                 next()
//             }
//         } else {
//             next('/login')
//         }
//     }
// })



export default router